home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / thinkref / archive / THINKPascalUH2.1.sea / THINKPas Univ Hdr 2.1 / Interfaces / QuickdrawText.p < prev    next >
Text File  |  1995-09-12  |  8KB  |  246 lines

  1. { Converted with MPW2TPas Tuesday, September 12, 1995 9:02:44 PM }
  2. {
  3.      File:        QuickdrawText.p
  4.  
  5.      Contains:    QuickDraw Text Interfaces.
  6.  
  7.      Version:    Technology:    System 7.5
  8.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  9.  
  10.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  14.                  stack.  Include the file and version information (from above)
  15.                  in the problem description and send to:
  16.                      Internet:    apple.bugs@applelink.apple.com
  17.                      AppleLink:    APPLE.BUGS
  18.  
  19. }
  20.  
  21.  UNIT QuickdrawText;
  22.  INTERFACE
  23.  
  24.  
  25. {$IFC UNDEFINED __QUICKDRAWTEXT__}
  26. {$SETC __QUICKDRAWTEXT__ := 1}
  27.  
  28.   USES
  29.    ConditionalMacros, Types, MixedMode;
  30.  
  31. { $PUSH}
  32. { $ALIGN MAC68K}
  33. { $LibExport+}
  34.  
  35. CONST
  36. { CharToPixel directions }
  37.     leftCaret                    = 0;                            {Place caret for left block}
  38.     rightCaret                    = -1;                            {Place caret for right block}
  39.     hilite                        = 1;                            {Direction is SysDirection}
  40.     smLeftCaret                    = 0;                            {Place caret for left block - obsolete }
  41.     smRightCaret                = -1;                            {Place caret for right block - obsolete }
  42.     smHilite                    = 1;                            {Direction is TESysJust - obsolete }
  43. {Constants for styleRunPosition argument in PortionLine, DrawJustified,
  44.  MeasureJustified, CharToPixel, and PixelToChar.}
  45.     onlyStyleRun                = 0;                            { This is the only style run on the line }
  46.     leftStyleRun                = 1;                            { This is leftmost of multiple style runs on the line }
  47.     rightStyleRun                = 2;                            { This is rightmost of multiple style runs on the line }
  48.     middleStyleRun                = 3;                            { There are multiple style runs on the line and this 
  49.  is neither the leftmost nor the rightmost. }
  50.     smOnlyStyleRun                = 0;                            { obsolete }
  51.     smLeftStyleRun                = 1;                            { obsolete }
  52.     smRightStyleRun                = 2;                            { obsolete }
  53.     smMiddleStyleRun            = 3;                            { obsolete }
  54.  
  55. { type for styleRunPosition parameter in PixelToChar etc. }
  56.     
  57. TYPE
  58.     JustStyleCode = INTEGER;
  59.  
  60.     FormatOrder = ARRAY [0..0] OF INTEGER;
  61.  
  62.     FormatOrderPtr = ^FormatOrder;
  63.  
  64.     OffPair = RECORD
  65.         offFirst:                INTEGER;
  66.         offSecond:                INTEGER;
  67.     END;
  68.  
  69.     OffsetTable = ARRAY [0..2] OF OffPair;
  70.  
  71.     StyleRunDirectionProcPtr = ProcPtr;  { FUNCTION StyleRunDirection(styleRunIndex: INTEGER; dirParam: UNIV Ptr): BOOLEAN; }
  72.     StyleRunDirectionUPP = UniversalProcPtr;
  73.  
  74. CONST
  75.     uppStyleRunDirectionProcInfo = $00000390; { FUNCTION (2 byte param, 4 byte param): 1 byte result; }
  76.  
  77. FUNCTION NewStyleRunDirectionProc(userRoutine: StyleRunDirectionProcPtr): StyleRunDirectionUPP;
  78.     {$IFC NOT GENERATINGCFM }
  79.     INLINE $2E9F;
  80.     {$ENDC}
  81.  
  82. FUNCTION CallStyleRunDirectionProc(styleRunIndex: INTEGER; dirParam: UNIV Ptr; userRoutine: StyleRunDirectionUPP): BOOLEAN;
  83.     {$IFC NOT GENERATINGCFM}
  84.     INLINE $205F, $4E90;
  85.     {$ENDC}
  86.  
  87. FUNCTION Pixel2Char(textBuf: Ptr; textLen: INTEGER; slop: INTEGER; pixelWidth: INTEGER; VAR leadingEdge: BOOLEAN): INTEGER;
  88.     {$IFC NOT GENERATINGCFM}
  89.     INLINE $2F3C, $820E, $0014, $A8B5;
  90.     {$ENDC}
  91. FUNCTION Char2Pixel(textBuf: Ptr; textLen: INTEGER; slop: INTEGER; offset: INTEGER; direction: INTEGER): INTEGER;
  92.     {$IFC NOT GENERATINGCFM}
  93.     INLINE $2F3C, $820C, $0016, $A8B5;
  94.     {$ENDC}
  95. FUNCTION PixelToChar(textBuf: Ptr; textLength: LONGINT; slop: Fixed; pixelWidth: Fixed; VAR leadingEdge: BOOLEAN; VAR widthRemaining: Fixed; styleRunPosition: JustStyleCode; numer: Point; denom: Point): INTEGER;
  96.     {$IFC NOT GENERATINGCFM}
  97.     INLINE $2F3C, $8222, $002E, $A8B5;
  98.     {$ENDC}
  99. FUNCTION CharToPixel(textBuf: Ptr; textLength: LONGINT; slop: Fixed; offset: LONGINT; direction: INTEGER; styleRunPosition: JustStyleCode; numer: Point; denom: Point): INTEGER;
  100.     {$IFC NOT GENERATINGCFM}
  101.     INLINE $2F3C, $821C, $0030, $A8B5;
  102.     {$ENDC}
  103. PROCEDURE DrawJustified(textPtr: Ptr; textLength: LONGINT; slop: Fixed; styleRunPosition: JustStyleCode; numer: Point; denom: Point);
  104.     {$IFC NOT GENERATINGCFM}
  105.     INLINE $2F3C, $8016, $0032, $A8B5;
  106.     {$ENDC}
  107. PROCEDURE MeasureJustified(textPtr: Ptr; textLength: LONGINT; slop: Fixed; charLocs: Ptr; styleRunPosition: JustStyleCode; numer: Point; denom: Point);
  108.     {$IFC NOT GENERATINGCFM}
  109.     INLINE $2F3C, $801A, $0034, $A8B5;
  110.     {$ENDC}
  111. FUNCTION PortionLine(textPtr: Ptr; textLen: LONGINT; styleRunPosition: JustStyleCode; numer: Point; denom: Point): Fixed;
  112.     {$IFC NOT GENERATINGCFM}
  113.     INLINE $2F3C, $8412, $0036, $A8B5;
  114.     {$ENDC}
  115. PROCEDURE HiliteText(textPtr: Ptr; textLength: INTEGER; firstOffset: INTEGER; secondOffset: INTEGER; VAR offsets: OffsetTable);
  116.     {$IFC NOT GENERATINGCFM}
  117.     INLINE $2F3C, $800E, $001C, $A8B5;
  118.     {$ENDC}
  119. PROCEDURE DrawJust(textPtr: Ptr; textLength: INTEGER; slop: INTEGER);
  120.     {$IFC NOT GENERATINGCFM}
  121.     INLINE $2F3C, $8008, $001E, $A8B5;
  122.     {$ENDC}
  123. PROCEDURE MeasureJust(textPtr: Ptr; textLength: INTEGER; slop: INTEGER; charLocs: Ptr);
  124.     {$IFC NOT GENERATINGCFM}
  125.     INLINE $2F3C, $800C, $0020, $A8B5;
  126.     {$ENDC}
  127. FUNCTION PortionText(textPtr: Ptr; textLength: LONGINT): Fixed;
  128.     {$IFC NOT GENERATINGCFM}
  129.     INLINE $2F3C, $8408, $0024, $A8B5;
  130.     {$ENDC}
  131. FUNCTION VisibleLength(textPtr: Ptr; textLength: LONGINT): LONGINT;
  132.     {$IFC NOT GENERATINGCFM}
  133.     INLINE $2F3C, $8408, $0028, $A8B5;
  134.     {$ENDC}
  135. PROCEDURE GetFormatOrder(ordering: FormatOrderPtr; firstFormat: INTEGER; lastFormat: INTEGER; lineRight: BOOLEAN; rlDirProc: StyleRunDirectionUPP; dirParam: Ptr);
  136.     {$IFC NOT GENERATINGCFM}
  137.     INLINE $2F3C, $8012, $FFFC, $A8B5;
  138.     {$ENDC}
  139. {$IFC OLDROUTINENAMES }
  140. FUNCTION NPixel2Char(textBuf: Ptr; textLength: LONGINT; slop: Fixed; pixelWidth: Fixed; VAR leadingEdge: BOOLEAN; VAR widthRemaining: Fixed; styleRunPosition: JustStyleCode; numer: Point; denom: Point): INTEGER;
  141.     {$IFC NOT GENERATINGCFM}
  142.     INLINE $2F3C, $8222, $002E, $A8B5;
  143.     {$ENDC}
  144. FUNCTION NChar2Pixel(textBuf: Ptr; textLength: LONGINT; slop: Fixed; offset: LONGINT; direction: INTEGER; styleRunPosition: JustStyleCode; numer: Point; denom: Point): INTEGER;
  145.     {$IFC NOT GENERATINGCFM}
  146.     INLINE $2F3C, $821C, $0030, $A8B5;
  147.     {$ENDC}
  148. PROCEDURE NDrawJust(textPtr: Ptr; textLength: LONGINT; slop: Fixed; styleRunPosition: JustStyleCode; numer: Point; denom: Point);
  149.     {$IFC NOT GENERATINGCFM}
  150.     INLINE $2F3C, $8016, $0032, $A8B5;
  151.     {$ENDC}
  152. PROCEDURE NMeasureJust(textPtr: Ptr; textLength: LONGINT; slop: Fixed; charLocs: Ptr; styleRunPosition: JustStyleCode; numer: Point; denom: Point);
  153.     {$IFC NOT GENERATINGCFM}
  154.     INLINE $2F3C, $801A, $0034, $A8B5;
  155.     {$ENDC}
  156. FUNCTION NPortionText(textPtr: Ptr; textLen: LONGINT; styleRunPosition: JustStyleCode; numer: Point; denom: Point): Fixed;
  157.     {$IFC NOT GENERATINGCFM}
  158.     INLINE $2F3C, $8412, $0036, $A8B5;
  159.     {$ENDC}
  160. {$ENDC}
  161.  
  162. TYPE
  163.     FontInfo = RECORD
  164.         ascent:                    INTEGER;
  165.         descent:                INTEGER;
  166.         widMax:                    INTEGER;
  167.         leading:                INTEGER;
  168.     END;
  169.  
  170.     FormatStatus = INTEGER;
  171.  
  172.  
  173. PROCEDURE TextFont(font: INTEGER);
  174.     {$IFC NOT GENERATINGCFM}
  175.     INLINE $A887;
  176.     {$ENDC}
  177. PROCEDURE TextFace(face: Style);
  178.     {$IFC NOT GENERATINGCFM}
  179.     INLINE $A888;
  180.     {$ENDC}
  181. PROCEDURE TextMode(mode: INTEGER);
  182.     {$IFC NOT GENERATINGCFM}
  183.     INLINE $A889;
  184.     {$ENDC}
  185. PROCEDURE TextSize(size: INTEGER);
  186.     {$IFC NOT GENERATINGCFM}
  187.     INLINE $A88A;
  188.     {$ENDC}
  189. PROCEDURE SpaceExtra(extra: Fixed);
  190.     {$IFC NOT GENERATINGCFM}
  191.     INLINE $A88E;
  192.     {$ENDC}
  193. PROCEDURE DrawChar(ch: CHAR);
  194.     {$IFC NOT GENERATINGCFM}
  195.     INLINE $A883;
  196.     {$ENDC}
  197. PROCEDURE DrawString(s: ConstStr255Param);
  198.     {$IFC NOT GENERATINGCFM}
  199.     INLINE $A884;
  200.     {$ENDC}
  201. PROCEDURE DrawText(textBuf: UNIV Ptr; firstByte: INTEGER; byteCount: INTEGER);
  202.     {$IFC NOT GENERATINGCFM}
  203.     INLINE $A885;
  204.     {$ENDC}
  205. FUNCTION CharWidth(ch: CHAR): INTEGER;
  206.     {$IFC NOT GENERATINGCFM}
  207.     INLINE $A88D;
  208.     {$ENDC}
  209. FUNCTION StringWidth(s: ConstStr255Param): INTEGER;
  210.     {$IFC NOT GENERATINGCFM}
  211.     INLINE $A88C;
  212.     {$ENDC}
  213. FUNCTION TextWidth(textBuf: UNIV Ptr; firstByte: INTEGER; byteCount: INTEGER): INTEGER;
  214.     {$IFC NOT GENERATINGCFM}
  215.     INLINE $A886;
  216.     {$ENDC}
  217. PROCEDURE MeasureText(count: INTEGER; textAddr: UNIV Ptr; charLocs: UNIV Ptr);
  218.     {$IFC NOT GENERATINGCFM}
  219.     INLINE $A837;
  220.     {$ENDC}
  221. PROCEDURE GetFontInfo(VAR info: FontInfo);
  222.     {$IFC NOT GENERATINGCFM}
  223.     INLINE $A88B;
  224.     {$ENDC}
  225. PROCEDURE CharExtra(extra: Fixed);
  226.     {$IFC NOT GENERATINGCFM}
  227.     INLINE $AA23;
  228.     {$ENDC}
  229. PROCEDURE StdText(count: INTEGER; textAddr: UNIV Ptr; numer: Point; denom: Point);
  230.     {$IFC NOT GENERATINGCFM}
  231.     INLINE $A882;
  232.     {$ENDC}
  233. FUNCTION StdTxMeas(byteCount: INTEGER; textAddr: UNIV Ptr; VAR numer: Point; VAR denom: Point; VAR info: FontInfo): INTEGER;
  234.     {$IFC NOT GENERATINGCFM}
  235.     INLINE $A8ED;
  236.     {$ENDC}
  237.  
  238. { $ALIGN RESET}
  239. { $POP}
  240.  
  241. {$ENDC} {__QUICKDRAWTEXT__}
  242.  
  243.  IMPLEMENTATION
  244.  END.
  245.  
  246.